package org.lxg.springmvc.service;

import org.lxg.common.pojo.User;
import org.lxg.springmvc.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    public UserMapper userMapper;

    public int insertUser(String id, String lastName){
        User u = new User(id, lastName);
        int i = userMapper.insertUser(u);
        return i;
    }

    public List<User> findUsers(){
        return userMapper.findAllUsers();
    }
}